package com.masterclient.app.modules.goods;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.masterclient.app.R;
import com.eoner.baselibrary.bean.goods.GoodDetailBean;
import com.eoner.baselibrary.utils.Utils;

/**
 * <pre>
 *     Copyright    : Copyright (c) 2019.
 *     Authour      : JiaoYa.
 *     Created Time : 2019/12/11.
 *     Desc         :
 *     Alter By     :
 * </pre>
 */
public class CouponAdapter extends BaseQuickAdapter<GoodDetailBean.DataBean.ShSalesrulesBean, BaseViewHolder> {

    private Context mContext;

    public CouponAdapter(Context mContext) {
        super(R.layout.item_coupon_goods2);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodDetailBean.DataBean.ShSalesrulesBean item) {
        helper.setText(R.id.tv_money_sign,"¥");
        Utils.setDin(helper.getView(R.id.tv_money_sign),mContext);
        helper.setText(R.id.tv_money,item.getSh_discount_amount());
        Utils.setDin(helper.getView(R.id.tv_money),mContext);
        helper.setText(R.id.tv_limit,item.getSh_nameX());
        helper.setText(R.id.tv_coupon_date,item.getSh_start_at()+"-"+item.getSh_end_at());
        helper.setText(R.id.tv_btn,/*!item.isClicked()?*/"立即领取"/*:"立即使用"*/);
        helper.addOnClickListener(R.id.tv_btn);
    }
}
